/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package com.fzhucc.modules.sciPersonnelInfo.domain;

import com.fzhucc.base.BaseEntity;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://eladmin.vip
* @description /
* @author yyg
* @date 2023-11-30
**/
@Entity
@Data
@Table(name="tb_sci_personnel_info")
public class SciPersonnelInfo extends BaseEntity implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "`id`")
    @ApiModelProperty(value = "id")
    private Integer id;

    @Column(name = "`zqxname`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "姓名")
    private String zqxname;

    @Column(name = "`sex`")
    @ApiModelProperty(value = "性别")
    private String sex;

    @Column(name = "`date_birth`")
    @ApiModelProperty(value = "出生年月")
    private String dateBirth;

    @Column(name = "`idcard`")
    @ApiModelProperty(value = "身份证号")
    private String idcard;

    @Column(name = "send_qz_time")
    @ApiModelProperty(value = "成功发送全总数据时间，发送成功才会记录")
    private Timestamp sendQzTime;

    @Column(name = "send_qz_qy_time")
    @ApiModelProperty(value = "成功发送全总企业信息数据时间，发送成功才会记录")
    private Timestamp sendQzQyTime;

    @Column(name = "`education`")
    @ApiModelProperty(value = "学历")
    private String education;

    @Column(name = "delete_time")
    @ApiModelProperty(value = "假删除时间")
    private Timestamp deleteTime;

    @Column(name = "`employer`")
    @ApiModelProperty(value = "工作单位")
    private String employer;

    @Column(name = "`job_title`")
    @ApiModelProperty(value = "现任职务")
    private String jobTitle;

    @Column(name = "`companyarea`")
    @ApiModelProperty(value = "企业所在区域  zqx_company_area")
    private String companyarea;

    @Column(name = "`workage`")
    @ApiModelProperty(value = "本工种工龄")
    private String workage;

    @Column(name = "`previous_year_achievements`")
    @ApiModelProperty(value = "职业资格及等级")
    private String previousYearAchievements;

    @Column(name = "`previous_year_skill`")
    @ApiModelProperty(value = "技术职称及等级")
    private String previousYearSkill;

    @Column(name = "`phone`")
    @ApiModelProperty(value = "移动电话")
    private String phone;

    @Column(name = "`email`")
    @ApiModelProperty(value = "电子邮件")
    private String email;

    @Column(name = "`address`")
    @ApiModelProperty(value = "通讯地址")
    private String address;

    @Column(name = "`matype`")
    @ApiModelProperty(value = "本企业劳模、工匠情况劳模工匠人才类型zqx_ma_type 以;分隔返回前端以数组的形式")
    private String matype;

    @Column(name = "`technology`")
    @ApiModelProperty(value = "所需技术领域  zqx_technology")
    private String technology;

    @Column(name = "`retype`")
    @ApiModelProperty(value = "需求类别 zqx_re_type  以;分隔返回前端以数组的形式")
    private String retype;

    @Column(name = "`is_edit`",nullable = false)
    @ApiModelProperty(value = "是否允许编辑默认否")
    private Integer isEdit;

    @Column(name = "`details`")
    @ApiModelProperty(value = "简介")
    private String details;

    @Column(name = "`pic`")
    @ApiModelProperty(value = "头像")
    private String pic;

    @Column(name = "`keyword`")
    @ApiModelProperty(value = "关键字;隔开")
    private String keyword;

    @Column(name = "`keyword_other`")
    @ApiModelProperty(value = "关键字其他填写")
    private String keywordOther;

    @Column(name = "`is_delete`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否删除 默认否")
    private Integer isDelete;

    @Column(name = "`user_id`",nullable = false)
    @ApiModelProperty(value = "用户id")
    public Long userId;

    @Column(name = "`org_area`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "地区组织机构区分  字典 zqx_org_area")
    private String orgArea;

    @Column(name = "`audit_status`",nullable = false)
    @NotBlank
    @ApiModelProperty(value = "审核状态 默认待审核  zqx_audit_status")
    private String auditStatus;

    @Column(name = "`is_show`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "是否小程序h5展示 默认不展示")
    private Integer isShow;

    @Column(name = "`sort`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "排序")
    private Integer sort;

    @Column(name = "`hot`",nullable = false)
    @NotNull
    @ApiModelProperty(value = "热度")
    private Integer hot;

    @Column(name = "`qy_id`")
    @ApiModelProperty(value = "劳模需求企业表id")
    private Integer qyId;

    public void copy(SciPersonnelInfo source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
